package net.lesscoding.shop.config;

import net.lesscoding.shop.common.Result;
import net.lesscoding.shop.exception.CustomerException;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author eleven
 * @date 2024/6/7 21:02
 * @apiNote
 */
@RestControllerAdvice
@Configuration
public class GlobalExceptionHandler {

    @ExceptionHandler(value = CustomerException.class)
    public Result<Boolean> customerExceptionHandler(CustomerException e) {
        return Result.error(e);
    }
}
